import request from '@/utils/request'



// 查询用户列表的接口
export default {
  getUserList(searchModel) {
    return request({
      url: '/user/list',
      method: 'get',
      params: {
        pageNo: searchModel.pageNo,
        pageSize: searchModel.pageSize,
        username: searchModel.username,
        phone: searchModel.phone // 确保包含phone参数
      }
    })
  },
  // 新增用户的接口
  addUser(user) {
    return request({
      url: '/user',
      method: 'post',
      data: user
    })
  },
   //修改
   updateUser(user) {
    return request({
      url: '/user',
      method: 'put',
      data: user
    })
  },
 getUserById(id) {
    return request({
     // url: '/user/' + id,
      url: `/user/${id}`,
      method: 'get',
    })
  },
  // 删除用户的接口
  deleteUser(id) {
    return request({
      url: `/user/${id}`,
      method: 'delete'
    })
  }
 
}


